$(function(){
    //发送验证码
    $(".getCode").on("click", function(){
        var phone = $("input[name=phone]").val();
        $.ajax({
            url: getBasePath()+"/sendSms.html", //跳转到发送短信的servlet
            async : true,
            type: "post",
            dataType: "json",
            data: {"phone":phone},
            success: function (data) {
                if(data == 'fail'){
                    alert("发送验证码失败");
                    return ;
                }
            }
        });
    })
});